fixed regression issue from last commit regarding filtering list items and inserting the table name when not needed