Fixed some bugs with the drag and drop