Improveed the auto save-all code