fixed selected row index bug