diff --git a/src/lokijs.js b/src/lokijs.js
index <HASH>..<HASH> 100644
--- a/src/lokijs.js
+++ b/src/lokijs.js
@@ -1882,7 +1882,7 @@ var loki = (function () {
         copyColl.cloneObjects = coll.cloneObjects;
       }
 
-      copyColl.maxId = (coll.data.length === 0) ? 0 : coll.data.maxId;
+      copyColl.maxId = (coll.data.length === 0) ? 0 : coll.maxId;
       copyColl.idIndex = coll.idIndex;
       // if saved in previous format recover id index out of it
       if (typeof (coll.indices) !== 'undefined') {
maxId fix for sissbruecker's issue #<I>

collection.maxId was not being restored properly in from
serialized/saved database