fix unknown var in if clause