adding protection in the case where do_root was not called