WF_IF isolated into fun to prevent var leakage