add eof support