recalculate content length