adds more logic for reading client handshake responses