diff --git a/index.html b/index.html
index 7ecbd7d..829e2ad 100644
--- a/index.html
+++ b/index.html
@@ -29,6 +29,7 @@
}
function renderTable(data, sortField) {
+ data = _.sortBy(data, 'title');
data = _.sortBy(data, sortField);
$.each(data, function(key, value) {
diff --git a/index.js b/index.js
index ad6c774..818576f 100644
--- a/index.js
+++ b/index.js
@@ -142,7 +142,7 @@ function normalizeGoogleData(book) {
publisher: _.trim(book.publisher, '"'),
series: '',
volume: '',
- publishedDate: book.publishedDate.substring(0, 4),
+ publishedDate: book.publishedDate ? book.publishedDate.substring(0, 4) : '',
coverurl: '',
description: book.description,
notes: '',