update upload function