Added a missing return to createPayload.