fixed collision detection