updated index.rb to support large collections