unread function improvement