fixing drag and drop bug