Added functions for drag and drop