Fix bug query is null