added errorhandlr