Fix the getreleasebykernel, the order by criteria must be in the select