added tests for error codes