add new ssh step; check if ssh connection is closed already before calling close