ssh reads from standard input thus breaking loop