Added third argument to specify publishing frequency