changed sor in queries