Plugged the exception handling code