fix flicker issue in Safari (http://d.pr/v/17CW5/1oPgxTc9, thanks @kaeladan!)