fix codelab, using timer and duration