avoid exception when payload length is accidentally detected as negative value, or short payload.