working with publish and validate