Fixed the control flow for the upload button on menu.