Added logic to run the shutdown scripts