Filtering out duplicate headers in listHeaders()