fix error without tty