added timeout counter for rudimentary button debouncing