updated the bucket manager for error handling