fix a bug that we've had for a long time where we don't handle EOF