Fixed a bug in the collision detection hooray