fix bd switch bug by adding connect and disconnect function for collector class