Added is_message_seen flag update logic