Fix P4 bugs when close select connections