needed an except block in shutdown routine