fix bug to update mouse position