added timeout for path finding