dlUrl should be set inside the if block