made switchActive a pubic function