Added checks to ensure the scripts exist before running them.