fixed: query result now building using layer metadata