improve the drag functions