Fixed missing if clause