fixing up the restore process