fix invalid currentBucket write