Prevent double error  in json generation when calling find_contained in and find_attribute