fixing the ssh for-loop