fix bug: num_frames argument is not working