fixed add_cpd and get_cpd