fixed typo with setting last frame index