fix raw query