added validation to posts form