made the check for number of links more precise