Added header background logic