refiing calculation of mode on dashboard