fixed calculation of string size