Add duplicate keyword

Fixed a bug when adding a keyword that already existed, the history was lost and started over.