Added path and root arguments to the transform callback