added reconnection code to joebot