quick fix
mv next_frame from extern to ptr
fix next_frame