Changed how error handler is called.