Fixed query issue