fix fromQuery with __toString methods