Added an Exception and simple test case