fix sorttable for multiple tables