input validation for posts and comments