fixed duplicate key insertion