made primaryChanged event more general purpose