Fix to collision detection