fixed undefined vars in buckets.php