restore prev tty ndx