implementing error codes