Set correct index