Fix the Exception at exit