fixed query error