count & refresh index