Fix the Counting and Storing of the Frames