DDF-862 added sorting options to query form