Improve sidebar message counter