Fixed flickering in header and main