This needs to be inside a FrameEndTask too.