fix status codes for flush exception