Fix ordering of preparePublish