Fix issue in the email gate functionality