test with exception handling