fix active index problem