Fix last frame bug