Fixed 'undefined type' error in setButtonState()