fixed glitch in generateParticle