Changed a variable name and added an alert to the if conditional.