added publish functionality