added validation to posts