Fix duplicate email error

#1041