Reorderd code block for email check.