Fix bug in safari