adds save at the end of proc if not quit