Re-implement wait for publish