Updated the email case function