add timer for flush