added error codes