fixed infinite loop and email serialization