added validations to posts and comments