Fixed bug when adding a new post