trying to fix mail function.