remove redundant if (...) since checked in outer loop