fixes #473 by checking save status and auto save the file