fixed selection bug in tables.