fix bug that caused JS errors on certain home pages