fixed the delay counter