updated the init to index