Added error handler to client