Added reconnect attempts if server is lost