“Dynamic” use of add_root is currently broken. See this reply for more information and workaround:
add_root