fixing dragging bug