corrected a bug inside index.rb