fixing bugs with dragging