added frame counter