Updated checking if we're already in the correct path.