added check for line 9999 end of file