modify free space check and autosave