Fixing order by problem with cache