validation for posts and comments