fix table search problems - revert some code from 9fc2b2f3629f5fcaf0bbb2a5243ae5cc8faf7f1d commit