Fixes the totalResult issue