public scripts refactoring
retry mail if err