Now detects whether the script has ran previously.