fix frame_num increment logic @coryvirok