fixed emailing scripts