reworked drag and drop logic