Fixed mix up with http_res and res variables