minor improvement to bucket.js