moved limit & offset into sql part, ref #90