small modification in ErrorHandler