minor table sorting bug fix