Add connection lost handler