fix potential critical handshake bug, edit logger so all logs in 1 file