fixed end-of-file probleM