Some updates on the upload function