fix wrong root and is_root method