fix message count
More perfs, less SQL