Fixed bug create layer from template