fixed end of file bug