init with index