update for node 0.8 tty api