You should validate payload at the top with an assert.