Fix bug when using safari.