query not in array bug fix