diff --git a/lib/mongodb/gridfs/gridstore.js b/lib/mongodb/gridfs/gridstore.js
index <HASH>..<HASH> 100644
--- a/lib/mongodb/gridfs/gridstore.js
+++ b/lib/mongodb/gridfs/gridstore.js
@@ -112,7 +112,7 @@ GridStore.prototype.write = function(string, close, callback) {
       var previousChunkNumber = self.currentChunk.chunkNumber;
       var leftOverDataSize = self.chunkSize - self.currentChunk.position;
       var previousChunkData = string.substr(0, leftOverDataSize);
-      var leftOverData = string.substr(leftOverData, (string.length - leftOverDataSize));
+      var leftOverData = string.substr(leftOverDataSize, (string.length - leftOverDataSize));
       // Let's finish the current chunk and then call write again for the remaining data
       self.currentChunk.write(previousChunkData, function(err, chunk) {
         chunk.save(function(err, result) {
Fixed bug with multiple writes of the first chunk