observer pattern for timer