Updated error handler to pass unmodified variables