fixed temrinal connection bug