make sure .close is on a separate thread, too