check array index exists for response array
fix query word handler