fix email unique in history table