fix core when doing queries with &'s in them