Re-add reconnect function