modified save helper