fix safari javascript issue