Fixing a bug in useStats