added limits and offsets to the queries