fix fenwick tree