fix the collision detection with the background