fix errors for position for adding index