prevent error stdin: is not a tty