fixed query system, but it does not play nice with kaminari...