fix negative messages count issue