detect instance creation/shutdown