Fix Javascript error on singleton pages.