Move video counter update to different function