fixed an error where total was 0 for rest resource collection