added missing result parameter. added extra reminder that headers must be set