Improved code for detecting error message
Add old email as a sample
Update test code for the old email