fixed  "Trying to get property of non-object" error when the order by clause doesn't reference a
field, but a value calculated in the select statement. In this case $item->expression is just a string