moved hiding of IDE window to before autosave