made dragging more robust