fixed compound query issue