fix set layer according to initLayer
fix again initLayer