added an extra safeguard against a potentially undefined req.bestPage in secondChanceLogin