Add More accurate path detection