Add missing 'res' in onError