Added and optional third argument to specify publishing frequency