fixed duplicate key insertion error