fix runtime shutdown detection