added some validation to posts