fix query issue