fixed duplicate key issue