fixed issue where input might be a nested path