url: Correction to scope of if statements when setting data