#317.Anonymous function changed on private function, sql query removed from loop.