Fix spelling of variable name
Move variable definition closer to use