add upload logic