fix bug in sidebar reports, move the function to philologic.js