changing the upload logic a bit