Fixed null publish bug