Fixed issue with js error causing problems in safari