add setCounter to class tim