fixed bug on shouldPublish