fix mouse handling