modify the way of getting buckets