Added commands to run before shutdown