Added naive reconnect function.