added payload length and checksum check.