fixed duplicate element issues casued by previous merge.