Added code to check all the msgs in payload, not just the first one