Make codes dependent on destroy