Changed template as per version 1.8 to make idx_opt actual optional