Added test for exception and add exception