correctly init index