fixes save before exiting, improves multi tasking