added validations to posts