added switch for upload