Fixed error in the exception handler