fixing header size calc bug