Fixed bug in payload generation