uploading logic improvements