Fixing error with col is undefined

I'm loading a lot of these on one page and for some reason after all of the inputs have been set there is an extra call to setColor where col is undefined.