Added reconnect logic to session