Made a change to create new bucket if the queue is modified while looping
Reviewed bu Senthil