makes the table selection work