modify code to download media