fix in layer structure optimization