fix sorting in schema