instead of heredoc which does not work, always surround cmd in double quotes during ssh()