Fixes page flicker on load