add timer and timeout