table descending sort, refactor begin/rescue in app.rb