removed unnecessary calls to maintain the layer state