fix update thresh time and make update to be a function