Modified how to update frame.