added merge_states and mergeStates hooks in DdSpec