The solution is simple
In an exccelent and informative article, Professor Marty Lockshin of York University, a rabbi, examined the difficulty raised by Deuteronomy 13:2-4 and tells the solutions offered in a Midrash and by several medieval Jewish commentators.[1] I will add another solution. Deuteronomy states: “If there appears among you a prophet or a dream-diviner – [...]