Fixed the payload download routine