added error status and code