Fix disconnect bug