fix mouse position detection