Updated path finding such that it will always abort if threshold exceeds
its maximum value