fix a bug about close