path detection