fixed a bug with sortOperators function