rename var to fix overshadowing of variable

rename `str` to `string` to fix overshadowing of variable