make sure ssh finishing does not hang