fixed duplicate layers in print function