Temporary fix for the tty issue not grep exit code and logging element tree to stdout