replaced Integer.MAX_VALUE from findAll(Sort sort) with actual count