Fixed wait call for ssh commands