fix for collision detection