fix the implementation of getHeadersString