Fixed order by bug