Collision detection working properly