replaced StringIO as io