adds reconnection code to clientConnectionFailed() (closes #25)