fixed a similar small bug with collision detection