fix for x is not defined in new safari