add publish functionality