fix not close ssh connection when error