Fixed a bug with Close() and a go-routine