fixed a bug in email patch