Fix condition
Simplify logic by fallback to `origin`