Adding publishing logic