added fix to Content-Length calc, must stringify first