fixed target path detection bug