fix array reference queries