automatic swicthing beteen link types