tweaked array handling in query mask