adding frame counter