added validation for titles and body content