Fix a logic issue when adding background tag