more robust cast of the charge string in a query