publish needs to be thread safe