added publication logic