fixing error handler for cli