fix: fix task dequeuing from the last bucket