added secure switching option