updated protocol to correctly handle parsing and setting of payload