add debug messaging on changing context