add functions for drag and drop