automatic save exception handling