Small change to upload function