fixing parseHeaders to return non-empty