fixing string iterator