Finally fixed the service disconnection bug.