bugfix for popular badges algorithm