trim path only if available