Add missing endif statement