Fix flickering in safari