added changes to paginate.rb