Added auto-saving feature.