added limits and offsets to query