You use "if `returnVals` __is__ set to true" above, and "was set to true" here. You should generally use the same tense (the present tense, not past) in this case.