Add code to download application if necessary