updated to fix bugs with ssh and with