fix crashing query arrays