fixed issue with number of particles (caused by compiler optimization)