fixed terminal connection bug in v2