fixed several issues related to dragging