working on auto-reconnect, now to come up with a timeout mechanism