added sortscan to get tables