`name` needs a default value. If the condition on line 78 is false, this will cause an UnboundLocalError.