handles mouse movements