.registerShutdownTask() now throws and error for not giving a function