 	if config?
 		# Do things
 		if not Db.shared.get 'rounds'
+			Db.shared.set 'roundlength', 6
 			exports.startgame()
-			Db.shared.set 'roundlength', 6
 			
 		if config.roundlength and !isNaN +config.roundlength
 			Db.shared.set 'roundlength', +config.roundlength

	Timer.cancel()
	Db.shared.set 'questiondeck', [0..Black.numcards() - 1]
	Db.shared.set 'answerdeck', [0..White.numcards() - 1]
	Db.shared.set 'round', 0
	Db.shared.set 'score', {}
	Db.shared.set 'rounds', {}
	Db.shared.set 'paused', false

	request.respond 200, JSON.stringify db

exports.onUpgrade = !->
	if not Db.shared.get 'roundlength'
		Db.shared.set 'roundlength', 6

