Added defensive code for missing data in payloads