added nested host handling for improving tunnelling functionality