Update the code due to API change.