Fix duplicate trailing frame bug