Small fix

 Hash#index is deprecated; using Hash#key