make ruby 1.9 happy

"Hash#index is deprecated; use Hash#key"