fix table selection bug