fix non-bool var used as if condition