add reconnect logic, version checking and region checking