Checkbox input variable updates after function fires

(topic deleted by author)