added saveAstextFile