rescue no-tty error