Added condition to ensure chain ids depend on BID only.