Adding some checking so _previousContext doesn’t get changed unnecessarily