added save function to ondrop