tempIss.str(tempStr);
This merely sets the content of the intenal buffer. It does not, however, reset the error flags that could be set on the stream from previous operations.
Saying tempIss.clear();
before you extract the second time should do the job.