threadsafe error handling and no need for string buffer in parser