Fix dragging to work smoothly