Fixed query safety deprecated exception