added validations for comments and posts