Updated post creation code