add reconnectiong functionality