Fix creating resource tree