Fixed logic for updating worm density