Fixing drag and drop bug