Since you use it only in conditioned block shouldn't be the assignment in the condition?