added popToRoot