Will change this to call countMessages directly so that we do not loose precision quint64 -> int