fixed getLayer()