add exception and error handlers