added debouncing feature, resolves #6