added switchTo log function