was sorting using the incorrect parameter