fix dragging bug