Added method switchTo() for easier supporting frames