changed assign index function when new layer is added