new version with support for base headers