only close body if no error