changed email system to use event listeners