correctly calculate embed link in stub