Correct wrong check of invalid line