Fix bug about email session invalid.