Added auto reconnect feature