Preventing crashing to determine if scanning was succcessful.