Added example for publish method