size calculation fix