function to flush the bucket added