fixed seg. fault in HBT calculation