fix an issue with js error on main and catalog page