Fixed the local path function