Since headers and info are optional, I added safety checks to make sure they exist