fix some bugs about line count and file name checking