[FOLD] handle eof