Updated publish code