fix query componentization logic.