fixed issues with queries (limit, offset)