Added validation for creating post.