added debounce for buttons