moved handlers
print exception during handshake