when encountering an array in the middle of the get query, use the last element