for-loop condition for checkDup