use correct error codes