added check on if the layer is custom