Fix screen flickering in safari