handle ieof in preview mode