amends for mail function