return status codes on error