fix the way unread documents is counted