Fix: use close instead of clear