Fixed bug with total frames