-- adding shutdown logic