fixed if and empty for and textContent