Also can publish from inside the function