custom sort for each table