fix is_root method, not returning boolean correctly