fix some bugs about upload