encasing erros in if statement
putting alerts in content classes