fixed small issue with different numbers of particles