changed updateAttr from private function to public