fixed GO routine leaking
We need to close connection after termination state to prevent routine leaking.