location sort fix