Fix for undefined index error when creating a new post.