fix the problem query