Fix use of function in OrderBy