Update function for publisher