Fix for main
Tweak to the upload code