The for loop traverses the ctx object until it hits a value so this so ctx[path] doesn't seem to be correct as ctx is a value (string)