added a disabled variable to keep track of state

this was in case there is no input element available, the disabled state
will not function correctly.