resolve index recalculation issues and forbid insertion in the future