added select logic on table click