Added more code to download in background.