change some code for uploading