add some fixes to the script.