remove duplicate $keys assignment