Fixed missing endif