Added z-index management in Layer