Add error handler and manteinance mode