implements #1322, fixed

adds a type check to #1322, else you iterate over every char in the string paths.