improved connect alive thread;