If the user changes the start or the goal and then clicks search again without resetting, it goes into an infinite loop.