Added content length calculation