properly set Content-Length