fix collision detection