Add EOF handler
Merge pull request #56 from k0kubun/end_of_file

Add EOF handler