fixed query issue