Refactored previous commit so the checks happen after selecting a reconnection candidate.