Since I don't know where you inserted the if statement, I can't be sure what your particular problem was, but if you insert it at the beginning and increment the counter, you shouldn't have any...