improvement on mouse dragging