Added validation for posts