added some validation for users and posts