Implemented auto save feature.