fixes save before exiting, improves multi tasking
update from master