added metadata
dynamically changing the z-index of the layers