fix terminate the instance.