fixing logic of reading through new messages