change if clause order