auto save and resume in case of crashes