add the drag fuction