check and update index