fix save mail function