improve 'tm' function with ssh.