Yes, in the if() the str is also declared