new optimization for time wait and logger