Fixed max frame numbers loop