replace thread with timer