Fix retrieval of query modules

Bug: 69872
Change-Id: I79bd2901c92c2afd3b294aa3c52f4cc35a6cf4d8