fixed a sorting problem that caused location to always want to be the sorting criteria