fixed the sort by given location test