Implement close
Handle EOF