damn... I missed the wait(), that's why the ssh connection sometimes may get stucked.