added tests for exception handling