fix pcd connect and disconnect bug