add code which parses handshake messages