fixes collision detection