header bg logic