add validation for layerId