Fixed mistake in sorting order