handshake timeout and more cleanup