add connection auto detect