-- added additional check for string length

breaking out of loop before string gets too long