Change current directory detection method