def on_menu_criteria_file(self, event):
        """
        read pmag_criteria.txt file
        and open change criteria dialog
        """
        if self.data_model == 3:
            dlg = wx.FileDialog(
                self, message="choose a file in MagIC Data Model 3.0  format",
                defaultDir=self.WD,
                defaultFile="criteria.txt",
                style=wx.FD_OPEN | wx.FD_CHANGE_DIR
            )
        else:
            dlg = wx.FileDialog(
                self, message="choose a file in a MagIC Data Model 2.5 pmagpy format",
                defaultDir=self.WD,
                defaultFile="pmag_criteria.txt",
                # wildcard=wildcard,
                style=wx.FD_OPEN | wx.FD_CHANGE_DIR
            )

        if self.show_dlg(dlg) == wx.ID_OK:
            criteria_file = dlg.GetPath()
            self.GUI_log.write(
                "-I- Read new criteria file: %s\n" % criteria_file)
        dlg.Destroy()
        replace_acceptance_criteria = pmag.initialize_acceptance_criteria(
            data_model=self.data_model)
        try:
            if self.data_model == 3:
                self.read_criteria_file(criteria_file)
                replace_acceptance_criteria = self.acceptance_criteria
                # replace_acceptance_criteria=pmag.read_criteria_from_file(criteria_file,replace_acceptance_criteria,data_model=self.data_model)
                # # just to see if file exists
                print(replace_acceptance_criteria)
            else:
                replace_acceptance_criteria = pmag.read_criteria_from_file(
                    criteria_file, replace_acceptance_criteria, data_model=self.data_model)  # just to see if file exists
        except Exception as ex:
            print('-W-', ex)
            dlg1 = wx.MessageDialog(
                self, caption="Error:", message="error in reading file", style=wx.OK)
            result = self.show_dlg(dlg1)
            if result == wx.ID_OK:
                dlg1.Destroy()
                return
        self.add_thellier_gui_criteria()
        self.read_criteria_file(criteria_file)
        # check if some statistics are in the new criteria but not in old. If
        # yes, add to  self.preferences['show_statistics_on_gui']
        crit_list_not_in_pref = []
        for crit in list(self.acceptance_criteria.keys()):
            if self.acceptance_criteria[crit]['category'] == "IE-SPEC":
                if self.acceptance_criteria[crit]['value'] != -999:
                    short_crit = crit.split('specimen_')[-1]
                    if short_crit not in self.preferences['show_statistics_on_gui']:
                        print("-I- statistic %s is not in your preferences" % crit)
                        self.preferences['show_statistics_on_gui'].append(
                            short_crit)
                        crit_list_not_in_pref.append(crit)
        if len(crit_list_not_in_pref) > 0:
            stat_list = ":".join(crit_list_not_in_pref)
            dlg1 = wx.MessageDialog(self, caption="WARNING:",
                                    message="statistics '%s' is in the imported criteria file but not in your appearence preferences.\nThis statistic will not appear on the gui panel.\n The program will exit after saving new acceptance criteria, and it will be added automatically the next time you open it " % stat_list,
                                    style=wx.OK | wx.ICON_INFORMATION)
            self.show_dlg(dlg1)
            dlg1.Destroy()

        dia = thellier_gui_dialogs.Criteria_Dialog(
            None, self.acceptance_criteria, self.preferences, title='Acceptance Criteria')
        dia.Center()
        result = self.show_dlg(dia)
        if result == wx.ID_OK:  # Until the user clicks OK, show the message
            self.On_close_criteria_box(dia)
            if len(crit_list_not_in_pref) > 0:
                dlg1 = wx.MessageDialog(self, caption="WARNING:",
                                        message="Exiting now! When you restart the gui all the new statistics will be added.",
                                        style=wx.OK | wx.ICON_INFORMATION)
                self.show_dlg(dlg1)
                dlg1.Destroy()
                self.on_menu_exit(None)
                # self.Destroy()
                # sys.exit()

        if result == wx.ID_CANCEL:  # Until the user clicks OK, show the message
            for crit in crit_list_not_in_pref:
                short_crit = crit.split('specimen_')[-1]
                self.preferences['show_statistics_on_gui'].remove(short_crit)