work around for bug in stringstream