[FIX] fix problem when discarding text after error