Getting quite a few errors after the initial run of the script. 