Updated test to throw an exception