fix struct size calculation