fix bug in safari based browser