fix sorting in table