fix bugs in timed mode