ok, I won't tell you what you should do to prevent it because there is nothing to do to prevent it at this point. It is a normal part of the tank cycling process. You should not add anything to the tank until the ammonia and nitrite are at zero. Once they are at zero and remain there a couple days without bouncing back, do a 50% water change. Then you can add the clean up crew to take care of diatoms. If you add the snails before the ammonia and nitrite are at zero, they will die.