Prevent flicker in webkit