change error codes into an enum. safer picking of error string.