added parseHandshake