only allocate a udict when necessary