fixed bug that prevented the use of limit and offset