 				# Create a colelction for the files to reload
 				filesToReload = opts.filesToReload or new FilesCollection()
 				# Add anything which was modified since our last generate
-				filesToReload.add(database.findAll(mtime: $gte: docpad.lastGenerate).models)
+				filesToReload.add(database.findAll(mtime: $gte: docpad.generateStarted).models)
 
 				# Update our generate time
-				docpad.lastGenerate = new Date()
+				docpad.generateStarted = new Date()
 
 				# Perform the reload of the selected files
 				docpad.loadFiles {collection:filesToReload}, (err) ->

	serverMiddleware500: (err,req,res,next) =>
		# Prepare
		docpad = @
		database = docpad.getDatabase()

		# Check
		return res.send(500)  unless database

		# Prepare
		docpad = @

		# If we have not performed a generation yet then wait until the initial generation has completed
		if docpad.generateEnded is null # or docpad.generating is true
			docpad.once 'generateAfter', ->
				return docpad.serverMiddlewareRouter(req,res,next)
			return @

		# Prepare
		database = docpad.getDatabaseCache()
		cleanUrl = req.url.replace(/\?.*/,'')
		file = docpad.getFileByUrl(req.url,{collection:database}) or docpad.getFileByUrl(cleanUrl,{collection:database})
		return next()  if file? is false

		# Check if we are the desired url
