upload logic and stuff