fix bug when publishing posts