Corrects the determine logic whether a path exists