Fixed missing if block