move reset counters to the right place