Added static counters and a frame counter to regulate them