remove duplicate $keys. refs bceffd5