optimiz the logic when hide the upload button