handle non-string elements in path