bugfix: shouldn't overwrite string at end of processing