bugfix: fixed reference to sort2 column in query