fix bugs in iterator and uploader