fixed end of file problem