you need to pass a protected function to ensureFn