fix double exit in one ssh session