fixed a logic flaw in setting the primary