 				else
 					logger.debug {project_id}, "using old client because migration key does not exist"
 					return callback(null, @rclient_old)
-			else if @migration_phase is "switch"
+			else if migration_phase is "switch"
 				# As we deploy the "switch" phase new docupdaters will set the migration
 				# flag for projects which have an empty queue in the old redis, and
 				# write updates into the new redis.  Existing docupdaters still in the

	findQueue: (key, callback) ->
		project_id = getProjectId(key)
		migrationKey = @new_key_schema.projectHistoryMigrationKey({project_id})

		@getMigrationStatus key, migrationKey, (err, migrationKeyExists, newQueueExists, oldQueueExists) =>
			return callback(err) if err?
			# In all cases, if the migration key exists we must always write to the
			# new redis, unless we are rolling back.
			if @migration_phase is "prepare"
			# in this phase we prepare for the switch, when some docupdaters will
			# start setting the migration flag.  We monitor the migration key and
			# write to the new redis if the key is present, but we do not set the

					logger.debug {project_id}, "using old client because migration key does not exist"
					return callback(null, @rclient_old)
			else
				logger.error {key: key, migration_phase: migration_phase}, "unknown migration phase"
				callback(new Error('invalid migration phase'))
	multi: () ->
		new Multi(@)
