add sanity check when reading payload