added is_first_frame and is_final_frame