update the script according the change of API