Updated publish functionality