clean up end of file