fixed logic around markign messages as read