better string io handling