avoid strange attributeerror on close; happens almost never but...