controls connection loss