fixed the maximum recursion depth RuntimeError on get_fieldnames