added validation to ensure title when creating posts