Update the script to work with API change.