Handling path in json check better