Fixed issue on non-unit pages

If there are no related cards, the JS would fail