Fix error when the mouse is already at the target