add the collision detection