Should be `count($payload)` instead of `count(payload)` me thinks ;)