fix flat nested resource lookup