Fixed the close connection issue.