updated to allow selection of all tables