add this.Close() and fix a bug