fixed issues with headers parsing