add helper to correctly resolve links