error handler fixes