fix size calculation