fix a hidden bug of orderBy