Move area code capture inside the if block