fix message counter